import base64
import time
from urllib import parse

from Crypto.Cipher import AES

def add_to_16(value):
    while len(value) % 16 != 0:
        value += '\0'
    return str.encode(value)

def encrypt():
    data = str(int(time.time()))
    key = "W9ctOLkmqc9fqmLw".encode('utf-8')
    mode = AES.MODE_ECB
    padding = lambda s: s + (16 - len(s) % 16) * chr(16 - len(s) % 16)
    cryptos = AES.new(key, AES.MODE_ECB)
    cipher_text = cryptos.encrypt(padding(data).encode("utf-8"))
    a = base64.b64encode(cipher_text).decode("utf-8")
    return parse.quote(a)


if __name__ == '__main__':
    a = encrypt()
    print(a)
    # UWGaL+97e/EwSfeAkYbd0Q==
    # 9EPUhYgK911QXfHEVb6Fuw==
